package com.yy.poly_.exercise_;

/**
 * chapter08  com.yy.poly_.exercise_
 * 2023-04-07 15:27
 *
 * @author yy yuyue
 * description : 不可描述
 * @date 2023/4/7 15:27
 */
public class PolyExercise02 {
    public static void main(String[] args) {
          Sub s = new Sub();
        System.out.println(s.count);
        s.display();//frame  框架
        Base b = s;
        System.out.println(b == s);
        System.out.println(b.count);
        b.display();
    }
}

class Base{ //父类
    int count = 10;
    public void display(){
        System.out.println(this.count);
    }


}


class Sub extends Base{   //这是类, 不是方法()
    int count = 20;
    public void display(){
        System.out.println(this.count);
    }
}
